package cn.edu.hunau.oop.day04.shape;

/**
 * @author hb
 * @date 2025-08-07 09:54:26
 */
public class Circle extends Shape{
    private int r;

    public Circle() {
    }

    public Circle(Point position, int r) {
        super(position);
        this.r = r;
    }

    @Override
    public double area() {
        return Math.PI*r*r;
    }

    @Override
    public boolean container(Point p) {
        return this.getPosition().distance()<=this.r;
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }
}
